package com.scau.os.deviceManagement;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class DeviceWindows extends Application {
    Pane pane = new Pane();
    Text head = new Text(140, 30, "Assigned(分配)\t\t\tOccupied(占用)\t\t\tWait(等待)");
    Text A1 = new Text(10, 60, "Device A(1)");
    Text A2 = new Text(10, 105, "Device A(2)");
    Text B1 = new Text(10, 150, "Device B(1)");
    Text B2 = new Text(10, 195, "Device B(2)");
    Text B3 = new Text(10, 240, "Device B(3)");
    Text C1 = new Text(10, 285, "Device C(1)");
    Text C2 = new Text(10, 330, "Device C(2)");
    Text C3 = new Text(10, 375, "Device C(3)");
    Text r1 = new Text(160, 62, "false");
    Text occupiedProcess1 = new Text(330, 60, "null");
    Text waitProcess1 = new Text(500, 60, "null");
    Text r2 = new Text(160, 107, "false");
    Text occupiedProcess2 = new Text(330, 105, "null");
    Text waitProcess2 = new Text(500, 105, "null");
    Text r3 = new Text(160, 152, "false");
    Text occupiedProcess3 = new Text(330, 150, "null");
    Text waitProcess3 = new Text(500, 150, "null");
    Text r4 = new Text(160, 197, "false");
    Text occupiedProcess4 = new Text(330, 195, "null");
    Text waitProcess4 = new Text(500, 195, "null");
    Text r5 = new Text(160, 242, "false");
    Text occupiedProcess5 = new Text(330, 240, "null");
    Text waitProcess5 = new Text(500, 240, "null");
    Text r6 = new Text(160, 287, "false");
    Text occupiedProcess6 = new Text(330, 285, "null");
    Text waitProcess6 = new Text(500, 285, "null");
    Text r7 = new Text(160, 332, "false");
    Text occupiedProcess7 = new Text(330, 330, "null");
    Text waitProcess7 = new Text(500, 330, "null");
    Text r8 = new Text(160, 377, "false");
    Text occupiedProcess8 = new Text(330, 375, "null");
    Text waitProcess8 = new Text(500, 375, "null");

    @Override
    public void start(Stage primaryStage) throws Exception {
        pane.getChildren().addAll(head, A1, A2, B1, B2, B3, C1, C2, C3);
        pane.getChildren().addAll(r1, occupiedProcess1, waitProcess1);
        pane.getChildren().addAll(r2, occupiedProcess2, waitProcess2);
        pane.getChildren().addAll(r3, occupiedProcess3, waitProcess3);
        pane.getChildren().addAll(r4, occupiedProcess4, waitProcess4);
        pane.getChildren().addAll(r5, occupiedProcess5, waitProcess5);
        pane.getChildren().addAll(r6, occupiedProcess6, waitProcess6);
        pane.getChildren().addAll(r7, occupiedProcess7, waitProcess7);
        pane.getChildren().addAll(r8, occupiedProcess8, waitProcess8);
        Group group = new Group();
        primaryStage.setScene(new Scene(group));
        primaryStage.show();
    }
}
